package com.tutorial.rendertext;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Toolkit;
import java.util.Map;

import javax.swing.JFrame;
import javax.swing.JPanel;

public class RenderText extends JFrame{
	public RenderText(){
		RenderTxt txt = new RenderTxt();
		this.getContentPane().add(txt);
		this.setVisible(true);
	}
		
	public static void main(String[] args) {
		new RenderText();
	}
}
class RenderTxt extends JPanel{
	Map desktopHints = null;;
	public RenderTxt(){
		Toolkit tk = Toolkit.getDefaultToolkit();
		desktopHints = (Map)tk.getDesktopProperty("awt.font.desktophints");
	}
	
	protected void paintComponent(Graphics g) {
		if(desktopHints!=null){
			System.out.println(desktopHints);
			Graphics2D g2d = (Graphics2D) g;
			g2d.addRenderingHints(desktopHints);
			
			g2d.drawString("RenderHintTest", 10, 10);
		}
	}
}